package c.x.jy.dao.dao;

import c.x.jy.dao.dto.TeacherConfigEntityDto;
import c.x.jy.dao.entity.TeacherConfigEntity;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 大师配置表
 * 
 * @author amwhyh
 * @email xxx@xx.com
 * @date 2021-05-24 18:37:36
 */
@Mapper
public interface TeacherConfigDao extends BaseMapper<TeacherConfigEntity> {
    @Select(" SELECT * from `t_teacher_config`  where  member_id=${memberId} limit 1 ")
    TeacherConfigEntity getByMemberId(Long memberId);

    @Select(" select tc.*,m.nickname as memberName,t.nickname as teacherName from (t_teacher_config tc LEFT JOIN t_member m on m.id=tc.member_id) LEFT JOIN t_teacher t on t.id=tc.teacher_id  ${ew.customSqlSegment}")
    IPage<TeacherConfigEntityDto> listforweb(IPage<TeacherConfigEntity> page, @Param(Constants.WRAPPER)  QueryWrapper<TeacherConfigEntity> query);
}

